<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<title>iScroll iPad example</title>
          <link rel="stylesheet" href="css/style.css">
  <script src="js/libs/jquery-1.7.1.min.js"></script>        
<script type="text/javascript" src="js/iscroll.js"></script>
<script src="phonegap-1.2.0.js" charset="utf-8"></script>

<script type="text/javascript">
var scrollContent;
var scrollContent2;
var scrollSide;

function loaded() {
    scrollContent = new iScroll('contentScroller');
    scrollSide = new iScroll('navScroller');
}

document.addEventListener('touchmove', function(e){ e.preventDefault(); }, false);
document.addEventListener('DOMContentLoaded', loaded, false);
</script>
                  <script>
                  var webdir='http://www.2admin.co.cc';
                  function getUrlVars2() 
                  {
                  var vars = {};
                  var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
                  vars[key] = value;
                  });
                  return vars;
                  }
                  $(document).ready(function() {
                       $('#commentform').submit(
                       function() 
                       {
                        if($('#sdetail').val()=="")
                        {
                            alert('กรุณากรอกรายละเอียด');
                            return false;
                        }   
                        $.post(webdir+'/ajax.php',{functioncall:'addsubforum',uid:localStorage.getItem("uid"),detail:$('#sdetail').val(),foid:getUrlVars2()['foid']} ,function(data) {
                                              var myObject = eval('(' + data + ')');
                                              if(myObject.error==0)
                                              {
                                                  alert('ตอบกลับเรียบร้อยแล้ว');
                                                  location.href="forum-detail.html?foid="+getUrlVars2()['foid'];
                                                  return false;
                                              }else
                                              {
                                                  alert('เกิดข้อผิดพลาด');
                                                  return false;
                                              }
                                              
                        });
                          
                       return false;
                       }
                       );
                       
                       var foid=getUrlVars2()['foid'];
                        $.post(webdir+'/ajax.php',{functioncall:'getsubforumbyfoid',uid:localStorage.getItem("uid"),foid:foid} ,function(data) {
                                              var myObject = eval('(' + data + ')');
                                              if(myObject.error==0)
                                              {
                                                   if(myObject.pic)
                                                     {
                                                         var pic="http://www.2admin.co.cc/images/user_c/"+myObject.pic;
                                                     }else
                                                     {
                                                         var pic="images/forum-detail-member.jpg";
                                                     }
                                                 var strtable='<li><div class="member"><img src="'+pic+'" width="110" height="110"><a class="name">'+myObject.username+'</a></div><div class="post"><h3>'+myObject.ftitle+'</h3><div class="meta">'+myObject.createdate+'</div>'+myObject.fdetail+'</div></li>';
                                                 $('.latest').append(strtable);
                                                 for(variable in myObject.data)
                                                 {
                                                     var obj = myObject.data[variable]; 
                                                     
                                                     if(obj.pic)
                                                     {
                                                         var pic="http://www.2admin.co.cc/images/user_c/"+obj.pic;
                                                     }else
                                                     {
                                                         var pic="images/forum-detail-member.jpg";
                                                     }
                                                     
                                                     var strtable='<li><div class="member"><img src="'+pic+'" width="110" height="110"><a class="name">'+obj.username+'</a></div><div class="post"><h3>'+myObject.ftitle+'</h3><div class="meta">'+obj.createdate+'</div>'+obj.detail+'</div></li>';
                                                     $('.latest').append(strtable);
                                                 }
                                                 scrollContent.refresh();
                                              
                                              }else
                                              {
                                                  alert('เกิดข้อผิดพลาด');
                                              }
                                              
                        });
                       
                       
                      
                  });
                  </script>
                   <script>
   function addpic()
  {
       navigator.camera.getPicture(onPhotoDataSuccess, onFail, 
                { quality : 100, 
                destinationType : Camera.DestinationType.DATA_URL, 
                sourceType : Camera.PictureSourceType.CAMERA, 
                allowEdit : true,
                encodingType: Camera.EncodingType.JPEG,
                targetWidth: 220,
                targetHeight: 300 }
                );
      
  }
  function onPhotoDataSuccess(imageData) {

      $('#img-profile').attr('src','data:image/jpeg;base64,'+imageData); 

       

    }
 </script>

<link rel="stylesheet" href="css/iscroll.css"> 
<link rel="stylesheet" href="css/login.css"> 



</head>
<body>

<div id="page">
    <div id="sidebar">
        <header>Menu</header>
        <nav>
                            <a href="javascript:void(0);"><img id="img-profile" onclick="addpic()" src="images/img-avatar.jpg" alt="img-avatar" /></a>
           <h3>Feature</h3>
           <ul id="navScroller" class="v">
                       <li><a href="forum.html" class="icon">Forum</a></li>
                      <li><a href="index.html" class="icon">Calendar</a></li>
                      <li><a href="message.html" class="icon">Private Message</a></li>
                      <li><a href="meetingroom.html" class="icon">Meeting Room</a></li>
                      <li><a href="download.html" class="icon">Document Download</a></li>
                  </ul>
        </nav>
    </div>

    <div id="content">
        <header>Forum</header>
        <article>
            <div id="contentScroller" class="clearfix">
                                  <div id="comment">

                      
                      
                      
  <!--  <div id="pagination">
        <ul>
            <li>Page 1 of 21</li><li class="current"><a href="http://www.infostant.com/search//1 ">1</a></li>
             <li><a href="">2</a></li>
             <li><a href="">3</a></li>
             <li><a href="">4</a></li>
             <li><a href="">5</a></li>
  
         </ul>
    </div>           -->
                                            <div id="detail">
                      <ul class="latest">

                              
                          </ul>
                      
                      </div>

                         <div id="respond">

                                        <div class="cancel-comment-reply">
                                            <small><a style="display:none;" href="/expobar-megacrem-minicontrol-1-gr-v-a-ne/#respond" id="cancel-comment-reply-link" rel="nofollow">กดที่นี่เพื่อยกเลิกการตอบ</a></small>
                                        </div>
                                        
                                        
                                        <form id="commentform" method="post" action="">
 
                                        
                                        <!--<p><small><strong>XHTML:</strong> You can use these tags: <code>&lt;a href=&quot;&quot; title=&quot;&quot;&gt; &lt;abbr title=&quot;&quot;&gt; &lt;acronym title=&quot;&quot;&gt; &lt;b&gt; &lt;blockquote cite=&quot;&quot;&gt; &lt;cite&gt; &lt;code&gt; &lt;del datetime=&quot;&quot;&gt; &lt;em&gt; &lt;i&gt; &lt;q cite=&quot;&quot;&gt; &lt;strike&gt; &lt;strong&gt; </code></small></p>-->
                                        <br>
                                        
                                        <p>&nbsp;&nbsp;<strong>รายละเอียด</strong><textarea tabindex="4" rows="10" cols="100%" id="sdetail" name="sdetail"></textarea></p>
                                        
                                        <p><input type="submit" value="Send" tabindex="5" id="submit" name="submit">

                                        </p>
                                        
                                        </form>
                                        
                                        </div>
                            
                            
                      </div>
            </div>
            

        </article>
    </div>
</div>
<script src="js/default/login.js"></script>

</body>
</html>